package top.wangjiu.reactive.rpc.model;

import lombok.*;

@AllArgsConstructor
@ToString
@Getter
public class RpcRequest {

    private String requestId;

    private String service;

    private String method;

    private int version = 0;

    @Setter
    private Long count = Long.MAX_VALUE;

    private boolean cancel = false;

    private Class[] paramTypes;

    private Object[] params;

    public RpcRequest(String requestId,Long count){
        this.requestId = requestId;
        this.count = count;
    }

    public RpcRequest(String requestId,boolean cancel){
        this.requestId = requestId;
        this.cancel = cancel;
    }

    public RpcRequest(String requestId, String service, String method, Class[] paramTypes, Object[] params){
        this.requestId = requestId;
        this.service = service;
        this.method = method;
        this.paramTypes = paramTypes;
        this.params = params;
    }

    public RpcRequest(String requestId, String service, String method,int version, Class[] paramTypes, Object[] params){
        this.requestId = requestId;
        this.service = service;
        this.method = method;
        this.paramTypes = paramTypes;
        this.params = params;
        this.version = version;
    }

    public RpcRequest(String requestId, String service, String method,int version, Class[] paramTypes, Object[] params,long resCount){
        this.requestId = requestId;
        this.service = service;
        this.method = method;
        this.paramTypes = paramTypes;
        this.params = params;
        this.version = version;
        this.count = resCount;
    }

}
